package com.zhiwen.common.enums;

import lombok.Getter;

/**
 * 通知类型枚举
 */
@Getter
public enum NotificationType {
    
    QUESTION_ANSWERED(1, "有人回答了您的问题"),
    ANSWER_COMMENTED(2, "有人评论了您的回答"),
    ANSWER_ACCEPTED(3, "您的回答已被采纳"),
    CONTENT_REVIEWED(4, "您的内容审核状态已更新"),
    SYSTEM_NOTICE(5, "系统通知"),
    CONTENT_LIKED(6, "您的内容收到了点赞"),
    USER_FOLLOWED(7, "有新用户关注了您");
    
    private final Integer value;
    private final String title;
    
    NotificationType(Integer value, String title) {
        this.value = value;
        this.title = title;
    }
    
    /**
     * 根据值获取枚举
     */
    public static NotificationType getByValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (NotificationType type : NotificationType.values()) {
            if (type.getValue().equals(value)) {
                return type;
            }
        }
        return null;
    }
} 